home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
eco30603.zip
/
ECO30603.LZH
/
ECO_MOU.INC
< prev
next >
Wrap
Text File
|
1993-03-08
|
2KB
|
67 lines
type
mouseaction = (mleft, mmiddle, mright, mboth, mmove, mnoaction);
reflowinfo = record { for powertools menus }
off, hioff: byte;
key : _keys;
prot : boolean;
end;
var
{ mouse }
keypoller : pointer;
moldx, moldy : word;
procedure __coordmou(var x: word; var y: word);
function __funcmou(var b: word; var x: word; var y: word): mouseaction;
function __isboxmou(x1, y1, x2, y2, cx, cy: word): boolean;
implementation
function __coordmou;
begin
x := (x+8) div 8; y := (y+8) div 8
end;
function __funcmou(var b: word; var x: word; var y: word): mouseaction;
var
buttons,
moux, mouy : word;
react : mouseaction;
begin
__statmou(buttons, moux, mouy);
react := mnoaction;
if ((buttons and _left_sup) > 0) then react := mleft;
if ((buttons and _right_sup) > 0) then react := mright;
if ((buttons and _middle_sup) > 0) then react := mmiddle;
if ((buttons and _left_sup) > 0) and ((buttons and _right_sup) > 0) then
react := mboth;
if (moldx <> moux) or (moldy <> mouy) then react := mmove;
moldx := moux; moldy := mouy;
b := buttons; x := moux; y := mouy;
__funcmou := react;
end;
function __isboxmou(x1, y1, x2, y2, cx, cy: word): boolean;
begin
__isboxmou := (cx >= x1) and (cx <= x2) and (cy >= y1) and (cy <= y2);
end;
begin
keypoller := nil;
end. { unit }